// by Xeno
#define THIS_FILE "fn_checktransport.sqf"
#include "x_setup.sqf"
private ["_chopper","_nr","_kbvar","_side"];
#ifndef __TT__
PARAMS_2(_chopper,_nr);
#else
PARAMS_3(_chopper,_nr,_side);
#endif

_kbvar = format ["Dmr%1_available", _nr];

while {!isNull _chopper && {GV(_chopper,GVAR(in_air))} && {!isNull (driver _chopper)}} do {sleep 2.453};

if (!isNull _chopper && {GV(_chopper,GVAR(in_air))} && {isNull (driver _chopper)}) then {
	_chopper setVariable [QGVAR(in_air), false, true];
	#ifndef __TT__
	GVAR(kb_logic1) kbTell [GVAR(kb_logic2),GVAR(kb_topic_side),_kbvar,"GLOBAL"];
	#else
	if (_side == blufor) then {
		GVAR(hq_logic_en1) kbTell [GVAR(hq_logic_en2),"HQ_W",_kbvar,"GLOBAL"];
	} else {
		GVAR(hq_logic_ru1) kbTell [GVAR(hq_logic_ru2),"HQ_E",_kbvar,"GLOBAL"];
	};
	#endif
};
